Add V3 billing opt-out functionality with admin-only deployment restrictions#1067
Merged
Merged
Conversation
…ictions Implement node-level V3 billing opt-out mechanism allowing farmers to exempt nodes from billing while restricting deployments to authorized twin admins. Add storage maps for opt-out tracking and admin list management. Include billing suppression logic for opted-out nodes in Created state, with zero-cost calculations for both standard and additional fees.
Implement client methods for V3 billing opt-out functionality including OptOutOfV3Billing, AddTwinAdmin, RemoveTwinAdmin, GetAllowedTwinAdmins, and IsNodeOptedOutOfV3Billing. Add corresponding event types NodeV3BillingOptedOut, TwinAdminAdded, and TwinAdminRemoved. Include comprehensive unit tests and update error definitions for new tfgrid and smart contract module errors.
…com/threefoldtech/tfchain into development-feat-v3-billing-opt-out
xmonader
approved these changes
Feb 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR: feat: v3 billing opt-out for node migration
Summary
Implement node-level V3 billing opt-out mechanism allowing farmers to exempt nodes from billing while restricting deployments to authorized twin admins.
Changes
pallet-tfgridNodeV3BillingOptOutstorage map (node_id → opted_out_at) andAllowedTwinAdminsstorage valueopt_out_of_v3_billing(farmer-callable),add_twin_admin/remove_twin_admin(council-gated)NodeV3BillingOptOuton node deletionpallet-smart-contract_create_node_contractand_create_rent_contract: only allowed twin admins can deploy on opted-out nodes (OnlyTwinAdminCanDeployOnThisNodeerror)Created/GracePeriod/Deletedstates on opted-out nodes;Createdcontracts return early to avoid unnecessary reserve/remit workTests: 11 new tests in
pallet-tfgrid, 9 new tests inpallet-smart-contract— all passing, no regressions.Notes
Related Issues:
Checklist:
Please delete options that are not relevant.